#pragma once
//Max amount of lines for the console
#define MAX_LENGTH 20
#define LINE_LEN 80
#define CHAR_HEIGHT 16
#define BAK_TIME .075f
#include "linkedlist.h"
#include <Windows.h>
#include "BeanieCore.h"

class console
{
private:
	console();
	~console();
	bool isShowing;
	LinkedList<char*> text;
	int linePos;
	BeanieCore* m_core;
	//+1 for Null Terminator
	char textBuffer[LINE_LEN+1];
	int consoleChar;
	float keyTimer;
	//Internal user only, adds a line to the linked list
	////Returns the line number
	int addLine(char* _in);
	void addConsole(char* _in);
public:
	//Grab the only instance
	static console & getInstance();
	void init(BeanieCore* a_core);
	//Adds a string to the console window
	////Returns what line number it is
	int addString(char* _in);
	void release();
	void draw();
	void toggleConsole();
	void clearConsole();
	inline bool active(){return isShowing;}
	void input();
	char keyPress();
};